<template>
  <div class="preview">
    <el-row>
      <el-col :span="6"><span>归属学科:</span> {{ previewList.subject_name }}</el-col>
      <el-col :span="6"><span>归属目录:</span> {{ previewList.directory_name }}</el-col>
      <el-col :span="6"><span>试卷状态:</span>  <el-tag type="success" size="mini">{{ previewList.show_state==1?'启用':'禁用' }}</el-tag></el-col>
      <el-col :span="6"><span>试卷类型:</span> {{ previewList.paper_type==1?'模拟卷':'真题卷' }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="6"><span>试卷难度: </span>
        <i v-if="previewList.difficulty==1" style="font-style:normal">简单</i>
        <i v-if="previewList.difficulty==2" style="font-style:normal">中等</i>
        <i v-if="previewList.difficulty==3" style="font-style:normal">较难</i>
      </el-col>
      <el-col :span="6"><span>试卷题型: </span>{{ JSON.parse(previewList.check_question_list).map(val=>{return val.name}).join() }}</el-col>
      <el-col :span="6"><span>试卷总分: </span>{{ previewList.total_score }}</el-col>
      <el-col :span="6"><span>及格分数: </span>{{ previewList.pass_score }}</el-col>
    </el-row>
    <el-row>
      <el-col :span="6"><span>创建人:</span> {{ previewList.create_name }}</el-col>
      <el-col :span="6"><span>创建时间:</span> {{ previewList.created_at | formatTime }}</el-col>
    </el-row>
    <el-row>
      <el-col>
        <div class="selectMsg">选题信息</div>
        <el-table border="" :data="JSON.parse(previewList.check_question_list)" empty-text="请勾选试卷包含题型，从而生成选题模板">
          <el-table-column label="题型" width="140" prop="name" />
          <el-table-column label="选题信息" width="1370">
            <template slot-scope="scope">
              <span>共
                <el-input v-model="scope.row.num" style="width:60px" />，每题
                <el-input v-model="scope.row.score" style="width:60px" />分，已选题数：<span style="color:#40b8ff">{{ scope.row.num }}</span> 题 </span>
              <el-button type="success">看题</el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: '',
  props: {
    previewList: {
      type: [Array, Object],
      default: null
    }
  },
  data() {
    return {
      questionList: [
        { type: 1, name: '单选题', num: 0, score: 0 },
        { type: 2, name: '多选题', num: 0, score: 0 },
        { type: 3, name: '判断题', num: 0, score: 0 },
        { type: 4, name: '简答题', num: 0, score: 0 }
      ]
    }
  },
  created() {},
  methods: {

  }
}
</script>

<style scoped lang='scss'>
.preview{
  line-height: 30px;
  span{
    color: #888888;
  }
}
.selectMsg{
  color:#303133;
  font-weight: 700;
  margin-top: 20px;
  line-height: 70px;
  border-top: 1px solid #dcdfe6;
}
</style>
